/*
 * @Description: 聊天记录
 * @Author: iamsmiling
 * @Date: 2021-06-01 21:36:39
 * @LastEditTime: 2021-06-01 21:46:49
 */
enum ChatMessageStatus {
  sendFailed,
  receiveFailed,
  unread,
  read,
  sendSucceed,
  receiveSucceed
}

extension ChatMessageStatusKit on ChatMessageStatus {
  String get label =>
      {
        ChatMessageStatus.sendFailed: "发送失败",
        ChatMessageStatus.sendSucceed: "送达",
        ChatMessageStatus.receiveFailed: "接收失败",
        ChatMessageStatus.receiveSucceed: "接收成功",
        ChatMessageStatus.read: "已读",
        ChatMessageStatus.unread: "未读"
      }[this] ??
      "";
}

class ChatRecordEntity {
  late String content;
  late DateTime? dateTime;
  late ChatMessageStatus status;

  late bool isMe;

  late String userAvatar = "https://i.loli.net/2021/04/13/2VkqWFU5sxwSQcu.png";

  ChatRecordEntity(
      {required this.content,
      this.dateTime,
      this.status = ChatMessageStatus.sendSucceed,
      this.isMe = false});
}
